'use client'
import { useSearchParams } from "next/navigation";

export default function DashboardLayout({
  admin,
  user,
  children,
}: Readonly<{
  admin: React.ReactNode;
  user: React.ReactNode;
  children: React.ReactNode;
}>) {
  // 获取路由参数
  const parms = useSearchParams();
  const role  = parms.get('role');
  return (
     <div className=" flex items-center justify-center h-full w-full">
      {role === 'admin' ? admin : user}
      {children}
     </div>
  );
}